#include<stdio.h>
#include"thread.h"
#include<pthread.h>
#include"initM0.h"

int main()
{
	int servFd = initServer();
	if(servFd < 0)
	{
		printf("initServer error!\n");
		return -1;
	}
	int connfd;
	while(1)
	{
		connfd = waitAccept(servFd);
		pthread_t threadId;
		while(-1 == pthread_create(&threadId, NULL, threadFunc, &connfd));
	}
	exitServer(connfd, servFd);
	return 0;
}
